/**
 * Coryright 2015-2020 www.eyaomall.cn
 * All rights reserved.
 * @author jipengfei
 * @date 2016年9月12日
 *
 */
package com.eyaomall.wxmall.dao;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.eyaomall.wxmall.model.po.Employee;
import com.lycheeframework.core.annotation.NameSpace;
import com.lycheeframework.core.support.DaoSupport;
/**
 * 店铺DAO
 * @author pro
 *
 */
@Repository
@NameSpace("employee")
public class EmployeeDao extends DaoSupport<Employee>  {
	/**
	 * 删除店员
	 */
	public boolean deleteById(Employee employee){
		return super.update("updateDeleted",employee) > 0 ? true : false;
	}
	
	/**
	 * 查询门店店长
	 */
	public Employee queryByJobName(Employee employee){
		return (Employee) super.query("queryByJobName",employee);
	}
	
	/**
	 * 修改门店店长
	 */
	public  boolean updateByJobName(Employee employee){
		return super.update("updateJobName",employee) > 0 ? true : false;
	}
	
	/**
	 * 修改店员信息
	 */
	public  boolean update(Employee employee){
		return super.update("update",employee) > 0 ? true : false;
	}
	/**
	 * 新增店员
	 */
	public int create(Employee employee){
		super.insert(employee);
		return employee.getId();
	}
	
	/**
	 * 根据ID查询门店信息
	 */
	public Employee queryById(Integer id){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("id", id);
		return (Employee) super.query("queryById", map);
	}
}
